<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>商品管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
			$(document).ready(function() {
		
						});
			function page(n,s){
					$("#pageNo").val(n);
					$("#pageSize").val(s);
					$("#searchForm").submit();
		        	return false;
		        }
		</script>
</head>
<body>
	<ul class="nav nav-tabs">
			<li class="active"><a href="${ctx}/shop/goods/goods/">商品列表</a></li>
			<shiro:hasPermission name="shop:goods:goods:edit"><li><a href="${ctx}/shop/goods/goods/form">商品添加</a></li></shiro:hasPermission>
		</ul>
	<form:form id="searchForm" modelAttribute="goods" action="${ctx}/shop/goods/goods/" method="post" class="breadcrumb form-search">
			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
			<ul class="ul-form">
				<li><label>名称：</label>
					<form:input path="name" htmlEscape="false" maxlength="255" class="input-medium"/>
				</li>
				<li><label>价格：</label>
					<form:input path="price" htmlEscape="false" maxlength="10" class="input-medium"/>
				</li>
				<li><label>品牌：</label>
					<form:input path="brand" htmlEscape="false" maxlength="255" class="input-medium"/>
				</li>
				<li><label>店铺：</label>
					<form:input path="store" htmlEscape="false" maxlength="255" class="input-medium"/>
				</li>
				<li><label>图片：</label>
					<form:input path="img" htmlEscape="false" maxlength="255" class="input-medium"/>
				</li>
				<li><label>详情：</label>
					<form:input path="content" htmlEscape="false" maxlength="255" class="input-medium"/>
				</li>
				<li><label>库存：</label>
					<form:input path="inventory" htmlEscape="false" maxlength="255" class="input-medium"/>
				</li>
				<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
				<li class="clearfix"></li>
			</ul>
		</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
			<thead>
			<tr>
					<th>名称</th>
					<th>价格</th>
					<th>品牌</th>
					<th>店铺</th>
					<th>图片</th>
					<th>详情</th>
					<th>库存</th>
					<th>更新时间</th>
					<th>备注信息</th>
					<shiro:hasPermission name="shop:goods:goods:edit"><th>操作</th></shiro:hasPermission>
				</tr>
		</thead>
			<tbody>
		<c:forEach items="${page.list}" var="goods">
				<tr>
					<td><a href="${ctx}/shop/goods/goods/form?id=${goods.id}">
						${goods.name}
					</a></td>
					<td>
						${goods.price}
					</td>
					<td>
						${goods.brand}
					</td>
					<td>
						${goods.store}
					</td>
					<td>
						<img src="${goods.img}" style="width: 100px;height: 50px">
					</td>
					<td title="${goods.content}">
							${fns:abbr(goods.content,30)}
					</td>
					<td>
						${goods.inventory}
					</td>
					<td>
						<fmt:formatDate value="${goods.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
					</td>
					<td>
						${goods.remarks}
					</td>
					<shiro:hasPermission name="shop:goods:goods:edit"><td>
	    				<a href="${ctx}/shop/goods/goods/form?id=${goods.id}">修改</a>
						<a href="${ctx}/shop/goods/goods/delete?id=${goods.id}" onclick="return confirmx('确认要删除该商品吗？', this.href)">删除</a>
					</td></shiro:hasPermission>
				</tr>
			</c:forEach>
		</tbody>
		</table>
	<div class="pagination">${page}</div>
</body>
</html>